function myflowJsonToXml(objs){
											   var xmlDoc;//定义xml文件
											   var ie = (typeof window.ActiveXObject != "undefined") ; 
											   var moz = (typeof document.implementation != "undefined") && (typeof document.implementation.createDocument != "undefined") ; 
											   if (moz) 
											   {  
												  	 var xmlDoc = document.implementation.createDocument("", "doc", null); //创建xml处理指令
		                         					 var root = xmlDoc.createProcessingInstruction("xml","version=\"1.0\" encoding=\"utf-8\""); //创建有命名空间的根节点                                    
		                         					 var oRoot =  xmlDoc.createElementNS("http://jbpm.org/4.4/jpdl","process");
		                         					 var pname=objs.props.props.name.value; //objs.props.props.name.value-新建流程
								 					 var key=objs.props.props.key.value;
								 					 //var description=objs.props.props.description.value;
								 					 if(pname==null||pname==""){
								 						pname = key;
								 					 }
		                             				 oRoot.setAttribute("name",pname);
												  	 oRoot.setAttribute("key",key);
													 //oRoot.setAttribute("description",description);
												   //oRoot.setAttribute("xmlns","http://jbpm.org/4.4/jpdl");
		                                         //循环添加各个子节点
		                         					 for (var rect in objs.states)
												  	 {
															var recttype =objs.states[rect].type; //子节点必须加命名空间的再次命名，否则会出现多余的属性xmlns=“”
												    	var rectnode=xmlDoc.createElementNS("http://jbpm.org/4.4/jpdl",recttype);  
												      //给节点添加属性g
															var gstr=objs.states[rect].attr.x;
																	gstr+=","+objs.states[rect].attr.y;
																	gstr+=","+objs.states[rect].attr.width;
																  gstr+=","+objs.states[rect].attr.height;
													    var namestr=objs.states[rect].text.text;
															rectnode.setAttribute("g",gstr);//给节点添加属性name				
															rectnode.setAttribute("name",namestr);
															rectnode.removeAttribute("xmlns");
															if(recttype=="task")//task节点添加assignee、form属性
															{
																if(objs.states[rect].props.assignee.value!="null")
																{
																	var assign=objs.states[rect].props.assignee.value;
																	rectnode.setAttribute("assignee",assign);
																}
																if(objs.states[rect].props.form.value!="null")
																{
																	var fo=objs.states[rect].props.form.value;
																	rectnode.setAttribute("form",fo);
																}
															}else
															if(recttype=="decision"){
																if(objs.states[rect].props.expr.value!="null")
																{
																	var expr=objs.states[rect].props.expr.value;
																	rectnode.setAttribute("expr",expr);
																}
															}else
															if(recttype=="join"){
																if(objs.states[rect].props.multiplicity.value!="null")
																{
																	var multiplicity=objs.states[rect].props.multiplicity.value;
																	rectnode.setAttribute("multiplicity",multiplicity);
																}
															}else
															if(recttype=="foreach"){
																if(objs.states[rect].props.in.value!="null")
																{
																	var inVariable=objs.states[rect].props.in.value;
																	rectnode.setAttribute("in",inVariable);
																}
																if(objs.states[rect].props.var.value!="null")
																{
																	var variable=objs.states[rect].props.var.value;
																	rectnode.setAttribute("var",variable);
																}
															}
													    oRoot.appendChild(rectnode);
													 		//添加各个子节点的路径
															for(var p in objs.paths)
															{
													 			if(objs.states[rect].text.text==objs.states[objs.paths[p].from].text.text)
													 			{
													 				var tran=xmlDoc.createElementNS("http://jbpm.org/4.4/jpdl","transition");
																	//给连线节点添加属性g
																	var att="";
																	//添加连线折点 的位置，x,y用","分开，不同折点的位置用";"隔开
																	for (var dot in objs.paths[p].dots)
																	{ 
																		att+=objs.paths[p].dots[dot].x+",";
																		att+=objs.paths[p].dots[dot].y+";";
																	}
																	//删除将最后一个";"改为":"
																	if(att!="")
																	{
																		att=att.substr(0,att.length-1)+":"; 
																	}
													 				att+=objs.paths[p].textPos.x;
													 				att+=","+objs.paths[p].textPos.y; 
                                  									tran.setAttribute("g",att);
                                  									var pathname=objs.paths[p].text.text;
													 				tran.setAttribute("name",pathname);
													 				var statename=objs.paths[p].to;
													 				for(var s in objs.states)
													 				{
													 					if(objs.states[s].text.text==objs.states[statename].text.text)
													 						var rectname=objs.states[s].text.text;
													 				} 
													 				tran.setAttribute("to",rectname);
													 				rectnode.appendChild(tran); 
																}
											   	 			}
											    	}  
											  		//把XML结点转化为字符串
		                        var xs = new XMLSerializer(); 
		                        //root结点是xml头文件  
		                        var a=xs.serializeToString(root,"text/xml");
		                        var b=xs.serializeToString(oRoot,"text/xml");
		                        a+=b;
		                        return a;
		                        //var xmlstr=encodeURIComponent(a);
		                        //var xmlname=encodeURIComponent(objs.props.props.name.value);
								//var jsonstr=encodeURIComponent(data);
	}
}		